load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "client",
    srcs = ["client.go"],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/middleware/logging/client",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/internal/log",
        "//src/internal/pctx",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//metadata",
        "@org_golang_google_protobuf//proto",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "client_test",
    size = "small",
    srcs = ["client_test.go"],
    embed = [":client"],
    deps = [
        "//src/internal/log",
        "@com_github_grpc_ecosystem_go_grpc_middleware//testing",
        "@com_github_grpc_ecosystem_go_grpc_middleware//testing/testproto",
        "@com_github_stretchr_testify//suite",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//metadata",
    ],
)
